<template>
  <div ref="ProgressChart" class="ProgressChart"></div>
</template>

<script>
import * as echarts from 'echarts'
export default {
  name: 'ProgressChart',
  mounted() {
    var myChart = echarts.init(this.$refs.ProgressChart)
    myChart.setOption({
      grid: {
        left: 0,
        right: 0
      },
      xAxis: {
        min: 0,
        max: 100,
        show: false
      },
      yAxis: {
        show: false,
        type: 'category',
        data: ['数据']
      },
      series: {
        type: 'bar',
        data: [78],
        // 柱条的宽度
        barWidth: 10,
        // 柱条的背景色
        showBackground: true,
        itemStyle: {
          color: 'red'
        },
        // 显示出对应的文字
        label: {
          show: true,
          formatter: '|', // 相当于是过滤器或是计算属性
          color: 'blue',
          position: 'right'
        }
      }
    })
  }
}
</script>

<style lang="scss" scoped>
.ProgressChart {
  width: 100%;
  height: 100%;
}
</style>